package com.dayuanit.dy16.atm.boatm.enums;

import com.dayuanit.dy16.atm.boatm.exception.BizException;

public enum SalaryStatus {
    //工资表状态 1-待上传 2-待入库 3-待审核 4-审核通过 5-拒绝

    wait_upload(1, "待上传"),
    wait_save(2, "待入库"),
    submit_verify(3, "提交审核"),
    wait_verify(4, "待审核"),
    approved(5, "审核通过"),
    refuse(6, "拒绝"),
    pay_off(7, "已完成");

    private int k;
    private String v;

    private SalaryStatus(int k, String v) {
        this.k = k;
        this.v = v;
    }

    public static SalaryStatus find(int k) {
        for (SalaryStatus s : SalaryStatus.values()) {
            if (k == s.getK()) {
                return s;
            }
        }

        throw new BizException("状态错误");
    }

    public int getK() {
        return k;
    }

    public String getV() {
        return v;
    }
}
